@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>AddressSearchAccordion</title>
</head>
<body>
    <script type="text/javascript">

        jQuery(document).ready(function () {
            $("#Nav").hide();
            $("#userprofileaccordion3").accordion();
            $("#userprofileaccordion2").accordion();
            
            $('#trgSearch').click(function (event) {
var myUrl ="./UserProfile/Search?UserName=" + $("#UserName").val() +  "&FirstName=" + $("#FirstName").val() +  "&LastName=" + $("#LastName").val() +  "&Address=" + $("#Address").val() +  "&City=" + $("#City").val() +  "&Region=" + $("#Region").val() +  "&PostalCode=" + $("#PostalCode").val() +  "&OfficePhone=" + $("#OfficePhone").val() +  "&CellPhone=" + $("#CellPhone").val() +  "&Title=" + $("#Title").val();
                $.ajax({
                    url: '@Url.Content("~/UserProfile/UserProfileGrid/")',
                    cache: false,
                    success: function (html) {
                        $("#userprofileaccordion3").accordion("activate", 1);
                        $('#UserProfilesearch').html(html);
                        $("#userprofilelist").setGridParam({ datatype: 'json', url: myUrl }).trigger("reloadGrid");
                        $('#userprofilelist').jqGrid('setGridParam', { onSelectRow: function (ids) {
                        UserId = ids ;
                            $.ajax({
                                url: '@Url.Content("~/UserProfile/UserProfileDetails/")' + UserId,
                                cache: false,
                                success: function (html) {
                                    $('#UserProfilereview').html(html);

                                }
                            });
                            $("#userprofileaccordion3").accordion("activate", 2);
                        }
                        });
                    }
                });

            });

			 $('#Details').click(function(event) {
				$.ajax({
					url: '@Url.Content("~/UserProfile/UserProfileDetails/")' + UserId,
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal:true});
					return false;
				}});
			});
			 $('#Add').click(function(event) {
				$.ajax({
					url: '@Url.Content("~/UserProfile/NewUserProfileForm/")',
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal:true});
					return false;
				}});
			});
			 $('#Update').click(function(event) {
				$.ajax({
					url: '@Url.Content("~/UserProfile/UpdateUserProfileForm/")' + UserId,
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal:true});
					return false;
				}});
			});
			 $('#Search').click(function(event) {
				$.ajax({
					url: '@Url.Content("~/UserProfile/UserProfileSearch/")' + UserId,
					cache: false,
					success: function (html) {
					$('#Main').html(html);
					return false;
				}});
			});
			 $('#Remove').click(function(event) {
				$.ajax({
					url: '@Url.Content("~/UserProfile/RemoveUserProfileForm/")' + UserId,
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal:true});
					return false;
				}});
			});
						 $('#Membership1').click(function(event) {
								$.ajax({
									url: '@Url.Content("~/Membership/MembershipGrid/")',
									cache: false,
									success: function (html) {
									$('#Main').html(html);
									$("#membershiplist").setGridParam({ datatype: 'json', url: "./Membership/GetBy_UserProfile_Membership_ByParent/" + UserId }).trigger("reloadGrid");
									return false;
								}});
								$.ajax({
									url: '@Url.Content("~/Membership/MembershipAccordion/")',
									cache: false,
									success: function (html) {
									$('#Nav').html(html);
									$('#Nav').show();
									return false;
								}});
							});
							 $('#OAuthMembership1').click(function(event) {
									$.ajax({
										url: '@Url.Content("~/OAuthMembership/OAuthMembershipGrid/")',
										cache: false,
										success: function (html) {
										$('#Main').html(html);
										$("#oauthmembershiplist").setGridParam({ datatype: 'json', url: "./OAuthMembership/GetBy_UserProfile_OAuthMembership_ByParent/" + UserId }).trigger("reloadGrid");
										return false;
									}});
									$.ajax({
										url: '@Url.Content("~/OAuthMembership/OAuthMembershipAccordion/")',
										cache: false,
										success: function (html) {
										$('#Nav').html(html);
										$('#Nav').show();
										return false;
									}});
								});
								 $('#UsersInRoles1').click(function(event) {
										$.ajax({
											url: '@Url.Content("~/UsersInRoles/UsersInRolesGrid/")',
											cache: false,
											success: function (html) {
											$('#Main').html(html);
											$("#usersinroleslist").setGridParam({ datatype: 'json', url: "./UsersInRoles/GetBy_UserProfile_UsersInRoles_ByParent/" + UserId }).trigger("reloadGrid");
											return false;
										}});
										$.ajax({
											url: '@Url.Content("~/UsersInRoles/UsersInRolesAccordion/")',
											cache: false,
											success: function (html) {
											$('#Nav').html(html);
											$('#Nav').show();
											return false;
										}});
									});
									 $('#UserProfileData1').click(function(event) {
											$.ajax({
												url: '@Url.Content("~/UserProfileData/UserProfileDataGrid/")',
												cache: false,
												success: function (html) {
												$('#Main').html(html);
												$("#userprofiledatalist").setGridParam({ datatype: 'json', url: "./UserProfileData/GetBy_UserProfile_UserProfileData_ByParent/" + UserId }).trigger("reloadGrid");
												return false;
											}});
											$.ajax({
												url: '@Url.Content("~/UserProfileData/UserProfileDataAccordion/")',
												cache: false,
												success: function (html) {
												$('#Nav').html(html);
												$('#Nav').show();
												return false;
											}});
										});
										 $('#ApplicationUser1').click(function(event) {
												$.ajax({
													url: '@Url.Content("~/ApplicationUser/ApplicationUserGrid/")',
													cache: false,
													success: function (html) {
													$('#Main').html(html);
													$("#applicationuserlist").setGridParam({ datatype: 'json', url: "./ApplicationUser/GetBy_UserProfile_ApplicationUser_ByParent/" + UserId }).trigger("reloadGrid");
													return false;
												}});
												$.ajax({
													url: '@Url.Content("~/ApplicationUser/ApplicationUserAccordion/")',
													cache: false,
													success: function (html) {
													$('#Nav').html(html);
													$('#Nav').show();
													return false;
												}});
											});
										        });
										    </script>
										    <div id="userprofileaccordion3">
												<h3><a href="#">Step 1: userprofile Search</a></h3>
											    <div>
										            User Name: <input type="text" name="UserName" id="UserName" />
										First Name: <input type="text" name="FirstName" id="FirstName" />
										Last Name: <input type="text" name="LastName" id="LastName" />
										Address: <input type="text" name="Address" id="Address" />
										City: <input type="text" name="City" id="City" />
										Region: <input type="text" name="Region" id="Region" />
										Postal Code: <input type="text" name="PostalCode" id="PostalCode" />
										Office Phone: <input type="text" name="OfficePhone" id="OfficePhone" />
										Cell Phone: <input type="text" name="CellPhone" id="CellPhone" />
										Title: <input type="text" name="Title" id="Title" />
										            <input type="button" value="Search" id="trgSearch" />
										        </div>
										
										        <h3><a href="#">Step 2: userprofile Select</a></h3>
											    <div>
										           <div id="UserProfilesearch"></div>
										        </div>
										
										        <h3><a href="#">Step 3: userprofile Review</a></h3>
											    <div>
										           <div id="UserProfilereview"></div>
										        </div>
										
										        <h3><a href="#">Step 4: userprofile Relationships</a></h3>
											    <div>
										           <div id="UserProfilerelate">
										            <div id="userprofileaccordion2">
										    <h3><a href="#">Edit Options</a></h3>
										     <ul>
										<li><a href="#" id="Add">Add</a></li>
										<li><a href="#" id="Update">Update</a></li>
										<li><a href="#" id="Search">Search</a></li>
										<li><a href="#" id="Remove">Remove</a></li>
										<li><a href="#" id="Details">Details</a></li>
												
											 </ul>
											 
											  <h3><a href="#">Related Items</a></h3>
											  <ul>
													 <li><a href="#" id='Membership1'>Membership</a></li>
													 <li><a href="#" id='OAuthMembership1'>O Auth Membership</a></li>
													 <li><a href="#" id='UsersInRoles1'>Users In Roles</a></li>
													 <li><a href="#" id='UserProfileData1'>User Profile Data</a></li>
													 <li><a href="#" id='ApplicationUser1'>Application User</a></li>
										               
										            </ul>
										    </div>
										            </div>
										        </div>
										    </div>
										</body>
										</html>